<div th:fragment="banner">
	<div id="banner"></div>
</div>

<!-- 轮播图 -->
<div th:fragment="slide">
	<div id="slide">
		<div id="imgs" data-interval="2000" data-ride="carousel" class="carousel slide">
			<div class="carousel-inner">
				<div class="item active">
					<img src="/img/hnucm/pic2.jpg" width="100%">
				</div>
				<div class="item">
					<img src="/img/hnucm/pic2.jpg" width="100%">
				</div>
				<ul class="carousel-indicators">
					<li data-target="#imgs" data-slide-to="0" class="active"></li>
					<li data-target="#imgs" data-slide-to="1"></li>
				</ul>
			</div>
			<a href="#imgs" data-slide="prev" class="carousel-control left" style="margin-top: 100px;">
				<</a> <a href="#imgs" data-slide="next" class="carousel-control right" style="margin-top: 100px;">>
			</a>
		</div>
	</div>
</div>

<!-- 导航条 -->
<div th:fragment="nav">
	<ul class="nav nav-pills col-center-block" id="nav"></ul>
	<script th:inline="javascript">
		function loadCategory() {
			const url = prefix + "/category/list";
			const _location = location.href;
			const categoryId = $.getUrlParam('c');

			$.get(url,function (ret) {
				var actions = [], firstCategoryItemId = '';
				$.each(ret.rows,function (index, item) {
					if (index === 0) {
						firstCategoryItemId = 'nav_'
							+ item.id;
					}
					let timestamp = (new Date()).valueOf();
					actions.push('<li id="nav_' + item.id + '" role="presentation" class=""><a href="/site/index/category/'
							+ item.id
							+ '?token='
							+ Math.random().toString(36)
							+ '&c='
							+ item.id
							+ '&t='
							+ timestamp
							+ '.html" >'
							+ item.name
							+ '</a></li>');
				});
				$('.nav').html(actions.join(''));
				if (categoryId) {
					$('#nav_' + categoryId).addClass("active");
				} else {
					$('#' + firstCategoryItemId).addClass("active");
				}
			});
		}

		$(function () {
			loadCategory();
		});
	</script>
</div>

<!-- 导航条下的文章 -->
<div th:fragment="articleItem">
	<div class="list-group category-article-item"></div>
	<script th:inline="javascript">
		function getArticleByCategory(categoryId) {
			let params = {
					pageSize: 10,
					pageNum: 1,
					menuId: categoryId,
					themeId:1,
					orderByColumn: 'createTime',
					isAsc: 'desc'
			};
			let url = prefix + "/article/list";
			$.post(url,params,function (ret) {
				let actions = [];
				$.each(ret.rows,function (index, item) {
							let timestamp = (new Date()).valueOf();
							let token = Math.random().toString(36);
							actions.push('<a class="list-group-item active" href="/site/index/article/'
									+ item.id
									+ '?token='
									+ token
									+ '&key='
									+ item.id
									+ '&c='
									+ categoryId
									+ '&t='
									+ timestamp
									+ '.html">'
									+ item.title
									+ '</a>');
						});
				$('.category-article-item').html(actions.join(''));
			});
		}
		$(function () {
			const categoryId = $.getUrlParam('c');
			getArticleByCategory(categoryId);
		})
	</script>
</div>

<!-- 单篇文章 -->
<div th:fragment="article">
	<div class="media">
		<div class="media-body">
			<h4 class="media-heading article-title">标题名称</h4>
			<div class="article-context">内容</div>
		</div>
	</div>

	<script th:inline="javascript">
		function getArticleById(id) {
			let url = prefix + "/article/get/" + id;
			$.get(url, function (ret) {
				$('.article-title').html(ret.title)
				$('.article-context').html(ret.content);
			})
		}
		$(function () {
			const articleId = $.getUrlParam('key');
			getArticleById(articleId);
		});
	</script>
</div>

<div th:fragment="today-article-img(themeId)">
	<div id="today">
		<input type="hidden" th:value="${themeId}" id="themeId" name="thmemeId" />
		<div class="hnucm-today-title"></div>
		<div class="list-group">
		</div>
		<script th:inline="javascript">
			function getArticleByThemeId(url,params,callback) {
				let detaultParams = {
					pageSize: 10,
					pageNum: 1,
					themeId: 1,
					orderByColumn: 'createTime',
					isAsc: 'desc'
				};
				var params = $.extend(detaultParams, params);
				
				$.post(url,params,callback);
			}
			$(function () {
				let categoryId = $.getUrlParam('c');
				let themeId = $('#themeId').val();
				
				let url = prefix + "/article/list";
				let params = {
					pageSize: 10,
					pageNum: 1,
					themeId: themeId,
					categoryId:categoryId
				}
				getArticleByThemeId(url,params,function (ret) {
					let actions = [];
					$.each(ret.rows,function (index, item) {
						let timestamp = (new Date()).valueOf();
						let token = Math.random().toString(36);
						let img = '<img src="'+item.imgSrc+'" />';
						actions.push('<a class="list-group-item hnucm-today-item" href="/site/index/article/'+ item.id + '?token='+ token + '&key=' + item.id + '&c=' + params.categoryId + '&t=' + timestamp + '.html">' 
								+ img + item.title + '</a>');
					});
					$('#today').find('.list-group').html(actions.join(''));
				});
			});
		</script>
	</div>
</div>

<!-- 热点新闻 -->
<div th:fragment="hot-news">
	<div id="hot-news" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">热点新闻</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item">
			<div class="hot-news-item-first">
				<img id="rdxw_img" src="http://210.42.176.68:8031/uploadFiles/wz/20191020214858245.jpg" class="w100">
				<span class="title hot-first-title">
					<h3>点赞！捐资百万的84岁老教师获5000元“正能</h3>
				</span>
				<p class="content">
					&nbsp;&nbsp;&nbsp;&nbsp;“耄耋之年、捐资百万，离休25载之后，她又用大义之举给世人上了震撼心灵的一课，只因教育牵系着一个国家的未来，只为尽己所能助力更多的贫困学子！”今...
					详情》》</p>
			</div>
			<div class="list-group">
				<a href="#" class="list-group-item l-border r-border">张公坡村精准扶贫</a> <a href="#"
					class="list-group-item l-border r-border">易刚强副校长带队参加2018“健康海丝”论坛开幕式暨福建中医药大学建校60周年纪念大会</a>
				<a href="#" class="list-group-item l-border r-border">秦裕辉参加第十一届庞鼎元国际中医药研讨会并走访港澳校友会</a>
				<a href="#" class="list-group-item l-border r-border">话校史、展未来，77级3班校友返校</a>
				<a href="#" class="list-group-item l-border r-border">话校史、展未来，77级3班校友返校</a>
			</div>
		</div>
	</div>
</div>
<!-- 通知公告 -->
<div th:fragment="noteic">
	<div id="noteic" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">通知公告</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item">
			<div class="noteic-l">
				<p class="c1">09-12</p>
				<p class="c2">2019</p>
			</div>
			<div class="noteic-r">
				<a href="">通知公告标题</a>
			</div>
			<div class="clear"></div>
		</div>
	</div>
</div>

<!-- 校友社区 -->
<div th:fragment="firends">
	<div id="firends" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">校友社区</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item"></div>
	</div>
</div>

<!-- 校友风采-->
<div th:fragment="person-style">
	<div id="person-style" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">校友风采</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="media">
			<div class="media-left">
				<a href="#"> <img class="media-object"
						src="http://210.42.176.68:8031/uploadFiles/wz/20190702183704893.gif" alt="..."
						style="width: 197px; height: 201px;">
				</a>
			</div>
			<div class="media-body">
				<h4 class="media-heading">郭振球</h4>
				<p class="content">人物简介：
					郭振球，湖南中医学院教授，博士研究生导师，全国名老中医，国务院特殊津贴专家。2002年美国诺贝尔医学院聘任为院士。出版有《中医诊断学》湖南省第六届政协委员，曾任湖南中医药大学医经、诊断学教研室主任、药学系主任，世界传统卫生组织诊断学专业委员会主任委员，国务院学位委员会博士点通讯评议专家，国家自然科学基金委员会函议专家等职。
					获得成就：
					1997年荣获国务院特殊津贴，2000年获英国皇家联盟科学院授予荣誉院士称号，2002年美国诺贝尔医学院聘任为院士。出版有《中医诊断学》2002年美国诺贝尔医学院聘任为院士。出版有《中医诊断学》2002年美国诺贝尔医学院聘任为院士。出版有《中医诊断学》...
				</p>
			</div>
		</div>
	</div>
</div>

<!-- 杏林文苑-->
<div th:fragment="cultural-center">
	<div id="cultural-center" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">杏林文苑</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item"></div>
	</div>
</div>


<!-- 校友活动-->
<div th:fragment="firend-life">
	<div id="firend-life" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">校友活动</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item"></div>
	</div>
</div>

<!-- 校友服务-->
<div th:fragment="firend-service">
	<div id="firend-service" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">校友服务</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item"></div>
	</div>
</div>


<!-- 活动连接-->
<div th:fragment="life-link">
	<div id="life-link" class="news-title">
		<div class="newsnavs">
			<h3 class="tit">活动连接</h3>
			<div class="hot-news-bg"></div>
			<div class="clear"></div>
		</div>
		<div class="more">
			<a href="javascript:void(0)" onclick="Click_List('热点新闻','BreakingNews','热点新闻')" class="fr">更多》</a>
		</div>
		<div class="hot-news-item"></div>
	</div>
</div>